<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="/lib/stylesheets/bootstrap.min.css" rel="stylesheet">

</head>
<body>
    <div ng-app="updateMerApp" ng-controller="updateMerCtrl">
        <button type="button" class="btn btn-default" ng-click="open()">Open me!</button>
        
        <script type="text/ng-template" id="updateMerContent.html">
        <div class="modal-header">
            <h3 class="modal-title" id="modal-title">个人信息</h3>
        </div>
        <form name="updateForm"  ng-submit="submitForm()">
			
        <div class="modal-body" id="modal-body">
            <div class="form-group">
                <label>头像</label>
                <img></img>
                <input type="file" class="form-control" ng-model='merchant.image' name="merchantImage" >
            </div>
            <div class="form-group" ng-class="{'has-success':updateForm.username.$valid}">
                <label>用户名</label>
                <input type="text" class="form-control" ng-model='merchant.username' name="username" ng-minlength="4" ng-maxlength="32" required>
                <p class="fa fa-check input_result success" ng-if="updateForm.username.$valid"></p>
				<p class="error" ng-if="updateForm.username.$error.required 
	                                 && updateForm.username.$touched">用户名不可为空</p>
				<p class="error" ng-if="(updateForm.username.$error.minlength 
                                      || updateForm.username.$error.maxlength) 
                                      && updateForm.username.$touched">用户名应该在4-32位之间</p>
            </div>
            <div class="form-group">
                <label>密码</label>
                <input type="password" class="form-control" ng-model='merchant.password' name="password" ng-minlength="6" ng-maxlength="25" required>
                <p class="fa fa-check input_result success" ng-if="updateForm.password.$valid"></p>
                <p class="error" ng-if="updateForm.password.$error.required 
                                     && updateForm.password.$touched">密码不可为空</p>
                <p class="error" ng-if="(updateForm.password.$error.minlength
                                     || updateForm.password.$error.maxlength) 
                                     && updateForm.username.$touched">密码应该在6-255位之间</p>
            </div>
            <div class="form-group" ng-class="{'has-success':signUpForm.password2.$valid}">
                <label>确认:</label>
                <input type="password" class="form-control" ng-model='merchant.password2' name="password" compare="merchant.password" required>
                <p class="fa fa-check input_result success" ng-if="signUpForm.password2.$valid"></p>
				<p class="error" ng-if="signUpForm.password2.$error.compare
	                                 && signUpForm.password2.$touched">两次密码输入不一致</p>
            </div>
            <div class="form-group">
                <label>地址</label>
                <input type="text" class="form-control" ng-model="merchant.address" id="ADDRESS">
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-warning" ng-click="cancel()">关闭</button>
            <button type="submit" class="btn btn-primary" >确认</button>
            <!--<script type="text/ng-template" id="alert.html">
            <div ng-transclude></div>
            </script>
        <div uib-alert ng-repeat="alert in alerts" ng-class="'alert-' + (alert.type || 'warning')" close="closeAlert($index)">{{alert.msg}}</div>-->
        </div>
        </div>
        </form>
        </script>
    </div>


<script src="/lib/js/angular.min.js"></script>
<!--<script src="ui-bootstrap-tpls.js"></script>-->
<script src="https://cdn.bootcss.com/angular-ui-bootstrap/0.11.2/ui-bootstrap-tpls.min.js"></script>
<script src="/js/updatemerchant.js"></script>
</body>
</html>